import uuid
import datetime
from typing import List

import pytz
from sqlalchemy import Column, String, JSON, DateTime, Text, Boolean

from app.db.DBConfig import Base
def utc_now():
    return datetime.datetime.now(pytz.timezone('Asia/Shanghai'))

class SoftCopyrightDB(Base):
    __tablename__ = "software_copyright"
    id = Column(String(36), primary_key=True, index=True, default=uuid.uuid4, comment="软著的id信息")
    system_name = Column(String(255), comment="系统名称")
    tech_stack = Column(String(255), comment="技术栈")
    feature_list = Column(JSON, comment="功能列表")
    config_data = Column(JSON, comment="配置数据")
    created_time = Column(DateTime, comment="创建时间", default=utc_now)
    preview_url = Column(String(511), comment="预览地址")
    introduction_doc = Column(String(511), comment="神奇表WORD下载")
    introduction_pdf = Column(String(511), comment="申请PDF下载地址")
    operation_doc = Column(String(511), comment="操作手册下载地址")
    operation_pdf = Column(String(511), comment="操作手册PDF下载地址")
    code_doc = Column(String(511), comment="代码文档下载地址")
    code_pdf = Column(String(511), comment="代码文档PDF下载地址")
    function_list_url = Column(JSON, comment="用于截图的url功能列表")
    status = Column(Boolean, comment="状态",default=False)
